const download = {
  byBlob(blob, filename) {
    let a = document.createElement('a');
    const url = window.URL.createObjectURL(blob);
    if (filename) {
      a.href = url;
      a.download = filename; // 给下载下来的文件起个名字
      a.click();
      window.URL.revokeObjectURL(url);
      a = null;
    }
  },
};

export default download;
